<?
/**
 * Dragons Fun copy
 * @author aanbek
 */
?><!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1" />
<meta name="author" content="Overmobile" />
<meta name="google" content="notranslate" />
<meta name="keywords" content="драконы, ферма, селекция, магия, сражения, гильдии, подземелья, походы, общение, mmorpg, друзья, подарки, pvp, overmobile, овермобайл, онлайн игра, пвп, приключения, бесплатная" />
<meta name="keywords" content=" драконы, ферма, селекция, магия, сражения, гильдии, подземелья, походы, общение, mmorpg, друзья, подарки, pvp, overmobile, овермобайл, онлайн игра, пвп, приключения, бесплатная" />
<meta property="og:title" content="Драконы. Онлайн-игра для мобильных телефонов" />
<meta property="og:image" content="http://mdragons.mobi/images/dragons/dragons.jpg" />
<meta property="og:url" content="http://mdragons.mobi/" />
<meta property="og:description" content="Вырасти самых сильных и редких драконов!" />
<meta property="og:type" content="website" />
<meta property="og:site_name" content="mdragons.mobi — Фэнтези. Магия. Драконы. Сражения." />
<link rel="stylesheet" type="text/css" href="/style.css"/>
<title><?=$title;?></title>
</head>
<body>
<div class="main">
    <? 
    if($user){
         $expProgress = round(100 / ($expLevel[$user['level']] / ($user['exp'] + 1))) + 1;
    if ($expProgress > 100) {
        $expProgress = 100;
    }
     
/**
* EXP 
*/ 
$exp = array(0,150,150,300,450,600,800,1000,1200,1560,3030,4580,7130,10720,16860,26560,40310,64770,101189,158830,252000);
        ?>
        <div class="header header_spring2">
<div class="header_in">
<div class="currency" onclick="location.href='/'">

<span class="nwr">
<img src="/images/food_16.png" width="16" height="16" alt=""><span><?=$user['food']?></span>
</span>
<span class="nwr">
<img src="/images/coin_16.png" width="16" height="16" alt=""><span><?=$user['coin']?></span>
</span>
<span class="nwr">
<img src="/images/crys_16.png" width="16" height="16" alt=""><span><?=$user['crys']?></span>
</span>

</div>

<div class="page_title">
<div class="page_title_in"><?=$title?></div>
</div>
<div class="lvl_c">








<a class="main_icon" href="./profile"><div class="main_icon_c"><div class="main_icon_b"></div><img src="/images/dragons/d_fire_1_120.jpg" width="24" height="24" alt="п"></div></a>
<a class="refresh" href="./?act=1553036823852"><img src="/images/refresh_26.png" width="26" height="26" alt="о"></a>
<div class="lvl_p">
<div class="lvl">
<div class="lvl_prg" style="width:<?=$expProgress;?>%;">%">&nbsp;</div>
</div>
</div>
</div>
</div>
</div>
<?
$usl = $user['level'] + 1;
if ($user['exp'] >= $exp[$user['level']]) {
        $newLevelGold = 5 * $user['level'];
        $updateLevelSql = "UPDATE `users` SET `level`=?,`exp`='0',`crys`=?
						   WHERE `id`=?";
        $updateLevelPl = array($user['level'] + 1, $user['crys'] + $newLevelGold,
            $user['id']);
        $updateLevelQuery = $db->query($updateLevelSql, $updateLevelPl);
$_SESSION['info']='
    
<div class="plate">
<div class="plate_b">
<div class="plate_bl">
<div class="plate_icon_bg">
<div class="plate_lvl_m">
<div class="plate_text">
<div class="plate_header">
<span class="str"><span>'.$usl.'</span> уровень взят!</span><br>
</div>
<div class="cntr">
Награда:
<span class="nwr"><img src="/images/crys_16.png" width="16" height="16" alt=""><span>'.$newLevelGold.'</span></span>



</div>
</div>
</div>
</div>
</div>
</div>
</div>';
header('location:/');
exit;
}
    }
        if (isset($_SESSION['info'])) {
    
   
				echo $_SESSION['info'];
			
    
    $_SESSION['info'] = null;
}
if (isset($_SESSION['error']))
{


				echo $_SESSION['error']; 
			
$_SESSION['error'] = null;
}
if (isset($_GET['logout'])) {
        $_SESSION['id'] = null;
        $_SESSION['password'] = null;
        header("Location:/");
        exit;
    }
    